﻿using B.T.Smark.APIRead.Applications.Command;
using B.T.Smark.Domain;
using B.T.Smark.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.T.Smark.APIRead.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        public UserController(IMediator mediator)
        {
            Mediator = mediator;
        }

        public IMediator Mediator { get; }
        [HttpGet]
        public async Task<APIResult<List<UserInfor>>> UserQuery([FromQuery]UserQueryCommand request )
        {
            return await Mediator.Send(request);
        }
    }
}
